package net.adetech.crj.service;

import net.adetech.crj.dao.ApplyMapper;
import net.adetech.crj.entity.Apply;
import net.adetech.crj.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service("apply.getApplyListByApplyUserId")
public class GetApplyListByApplyIdNumberService implements BaseService {
    @Autowired
    ApplyMapper applyMapper;
    @Override
    public Map<String, Object> invoke(Map<String, Object> params) {
        String applyUserId = (String)params.get("applyUserId");
        User user = (User)params.get("user");
        String summary = "A";
        if ("1".equals(user.getUserType()))
        {
            summary ="A";
        }
        else {
            summary = "B";
        }
        List<Apply> applyList = applyMapper.getApplyListByApplyUserId(applyUserId,summary);
        Map<String,Object> resultMap = new HashMap<String, Object>();
        resultMap.put("applyList",applyList);
        return resultMap;
    }
}
